package pratice.aop;

import framework.util.aopLog.Log;
import yxc.bo.YxcGoods;

/**
 * 现在我要学习用AOP记录跑步跑了多长时间
 * @author 吴宇亮 on 2019/6/22 8:27
 */
public class Run implements Sport {

    private String hello = "hello";

//    @Log(modelName = "测试注解", funcName = "测试1")
    @Override
    public String doSport() {
        try {
            System.out.println("测试注解");
            Thread.sleep(100L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "doSport()";
    }
    @Log(modelName = "测试注解", funcName = "测试2")
    @Override
    public String doSport(String test1) {
        throw new NullPointerException("测试切点异常");
//        return "doSport(String test1)";
    }

//    @Log(modelName = "测试注解", funcName = "测试3")
    @Override
    public String doSport(String test1, Integer test2, YxcGoods test3) {
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "doSport(String test1, Integer test2, YxcGoods test3)";
    }
}
